<template>
  <u-upload :fileList="fileList1"
            @afterRead="afterRead"
            @delete="deletePic"
            name="1" :multiple="multiple" :maxCount="maxCount" :disabled="disabled"
            :width="width" :height="height"/>
</template>
<script>
import {uploadMixins} from "@/mixins/uploadMixins";

export default {
  name: "y-upload-img",
  mixins: [uploadMixins],
  props: {
    value: {
      type: Array,
      default: () => []
    },
    multiple: {
      type: Boolean,
      default: false
    },
    maxCount: {
      type: Number | String,
      default: 1
    },
    width: {
      type: Number | String,
      default: 100
    },
    height: {
      type: Number | String,
      default: 100
    },
    disabled: {
      type: Boolean,
      default: false
    }
  },
  created() {
    console.log(this.value)
  },
  data() {
    return {
      fileList1: this.value
    }
  },
  watch: {
    fileList1(newVal) {
      this.$emit('input', newVal)
    },
    maxCount(n) {
      this.multiple = n > 1
    },
    value(n){
      this.fileList1 = n
    },
  }
}
</script>


<style scoped lang="scss">

</style>
